<%@page import="com.shsh.safemanage.model.Department2"%>
<%@page import="com.shsh.safemanage.action.ActionCreator"%>
<%@page import="com.shsh.safemanage.action.WriteProblemAction"%>
<%@page import="com.shsh.safemanage.model.Role"%>
<%@page import="com.shsh.safemanage.model.Department3"%>
<%@page import="com.shsh.safemanage.dao.DepartmentDao"%>
<%@page import="com.shsh.safemanage.model.Equipment"%>
<%@page import="java.util.List"%>
<%@page import="com.shsh.safemanage.util.Constants"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.dao.EquipmentDao"%>
<%@page import="com.shsh.safemanage.model.User"%>
<%@ page language="java" pageEncoding="UTF-8"%>

<%
{
User loginUser = (User) session.getAttribute(Constants.SESSION_USER);
EquipmentDao theEquipmentDao = DaoCreator.createEquipmentDao();
DepartmentDao theDepartDao = DaoCreator.createDepartmentDao();

Long equipID = 0L;
Department2 depart2 = theDepartDao.getDepartment2ByID(loginUser.getDepartment2ID());
if (depart2.isEquip()) {
	equipID = depart2.getEquipID();
}

String equipIDStr = request.getParameter(Constants.REQUEST_PARAMETER_EQUIP_ID);
try {
	equipID = new Long(equipIDStr);
} catch (Exception e) {
}

List<User> zhuangzhizhangList = theEquipmentDao.getEquipmentZhuangzhizhang(equipID);
List<User> zhuangzhizhangList2 = theEquipmentDao.getEquipmentMappingUser(equipID, Constants.DEPARTMENT_TYPE_SHIYEBU);
zhuangzhizhangList.addAll(zhuangzhizhangList2);
%>
<span style="margin-left: 40px" class="span1">通知人：</span>
<%
	StringBuffer equipLeadersStr = new StringBuffer();
	for (int i = 0; i < zhuangzhizhangList.size(); i++) {
		if (i == 0) {
			equipLeadersStr.append(zhuangzhizhangList.get(i).getName());
		} else {
			equipLeadersStr.append(" ");
			equipLeadersStr.append(zhuangzhizhangList.get(i).getName());
		}
	}
%>
<input type="text" id="informedPerson" size="40" readonly="readonly"
	value="<%=equipLeadersStr%>" style="background-color: CCCCFF;" />
<%
}
%>